X if (-1 != VerifyCourse(sizeof(acSub)-1 + *ppch)) {
X pcTemp = environ[iCourses];
X environ[iCourses] = *ppch;
X *ppch = pcTemp;
X ++iCourses;
X }
X *pcIndex = '=';
X }
X }
X if (1 < iCourses) {
X qsort((char *)environ, iCourses, sizeof(char *), q_compare);
X }
}
X
X
/*
X * Search the subscribed courses (the SUB_<course> environment (ksb/aho)
X * varibles) for a single course this submission is to. If
X * there is more than one subscribed course, use pcGuess to
X * arbitrate. If we fail, return (char *)0.
X *
X * note: we assume that FixEnvironment() has been called before us
X */
static char *
Which(pcGuess)
char *pcGuess;
{
X register char **ppch;
X register char *pcCourse;
X register int i;
X
X pcCourse = (char *)0;
X for (ppch = environ; ppch < & environ[iCourses]; ++ppch) {
X /* two course in env, no -c, use Ask from main
X */
X if ((char *)0 != pcCourse) {
X return (char *)0;
X }
X pcCourse = sizeof(acSub)-1 + *ppch;
X if ((char *)0 == pcGuess) {
X continue;
X }
X i = strlen(pcGuess);
X if (0 == strncmp(pcGuess, pcCourse, i) && '=' == pcCourse[i]) {
X return pcCourse;
X }
X pcCourse = (char *)0;
X }
X return pcCourse;
}
X
/*
X * List the courses the user is subscribed to which are also in the
X * course list.
X */
static void
ListSubscribed(fp)
FILE *fp;
{
X register char **ppchEnv;
X register char *pc;
X register int chSep = ':';
X
X if (0 == iCourses) {
X fprintf(fp, "You are not subscribed to any courses.\n");
X return;
X }
X fprintf(fp, "You are subscribed to");
X for (ppchEnv = environ; ppchEnv < & environ[iCourses]; ++ppchEnv) {
X if ((char *)0 == (pc = strchr(sizeof(acSub)-1 + *ppchEnv, '='))) {
X continue;
X }
X *pc = '\000';
X fprintf(fp, "%c %s", chSep, sizeof(acSub)-1 + *ppchEnv);
X *pc = '=';
X chSep = ',';
X }
X putc('\n', fp);
}
X
/*
X * get the words of wisdom from the user (ksb)
X * strip leading white space, etc
X */
char *
GetWord(pcBuf, iLen, pcDef)
char *pcBuf, *pcDef;
int iLen;
{
X register char *pcWhite, *pcCopy;
X register int l;
X
X fflush(stdout);
X pcBuf[0] = '\n';
X if ((char *)0 == fgets(pcBuf, iLen, stdin))
X return (char *)0;
X pcWhite = pcBuf;
X while (isspace(*pcWhite) && '\n' != *pcWhite)
X ++pcWhite;
X
X pcCopy = pcBuf;
X l = iLen;
X while (l-- > 0 && '\n' != (*pcCopy = *pcWhite))
X ++pcCopy, ++pcWhite;
X
X if (pcCopy == pcBuf)
X (void)strncpy(pcBuf, pcDef, iLen);
X else
X *pcCopy = '\000';
X return pcBuf;
}
X
/*
X * We couldn't figure out the course, so now we ask the user (aho)
X * interactively. We return the course and div/sec as
X * follows: cs100=d1s1
X *
X * invariant: we do not return (char *)0
X */
char *
AskCourse()
{
X register char **ppch;
X auto struct group *grpMe;
X static char acBuf[MAXCOURSENAME + MAXDIVSEC];
X static char acDef[MAXCOURSENAME + MAXDIVSEC];
X
X /* if our groupname is a valid course, use it as the default
X * else if our groupname is the group for a course, use that
X */
X acDef[0] = '\000';
X (void)setgrent();
X if ((struct group *)0 != (grpMe = getgrgid(getgid()))) {
X (void)strcpy(acDef, grpMe->gr_name);
X if (-1 == VerifyCourse(acDef)) {
X register int i;
X for (i = 0; (char *)0 != apcCourse[i]; ++i) {
X if (0 == strcmp(apcGroup[i], acDef))
X break;
X }
X if ((char *)0 != apcCourse[i]) {
X (void)strcpy(acDef, apcCourse[i]);
X } else {
X acDef[0] = '\000';
X }
X }
X }
X (void)endgrent();
X
X switch (iCourses) {
X case 0:
X printf("\
You are not suscribed to any valid course, here is a list of the courses\n\
you may use currently:\n");
X ListCourses(stdout);
X /* use the first course as the default
X */
X if ('\000' == acDef[0] && (char *)0 != apcCourse[0]) {
X (void)strcpy(acDef, apcCourse[0]);
X }
X break;
X default:
X ListSubscribed(stdout);
X /* use the first subscribed course as the default
X */
X if ('\000' == acDef[0]) {
X register int i;
X register char *pcIndex;
X
X pcIndex = environ[0] + sizeof(acSub)-1;
X for (i = 0; '=' != pcIndex[i]; ++i) {
X acDef[i] = pcIndex[i];
X }
X acDef[i] = '\000';
X }
X printf("\nIf the course you wish to submit to is not on the above list, try it anyway\n");
X break;
X }
X printf("Enter course name? [%s] ", acDef);
X
X if ((char *)0 == GetWord(acBuf, MAXCOURSENAME, acDef)) {
X fprintf(stderr, "%s: invalid course name\n", progname);
X exit(6);
X }
X if (-1 == VerifyCourse(acBuf)) {
X fprintf(stderr, "%s: cannot find \"%s\" in the course list\n", progname, acBuf);
X exit(7);
X }
X /*
X * if the user is subscribed to this course, don't ask him
X * for divsion/section, return the info here
X */
X for (ppch = environ; ppch < & environ[iCourses]; ++ppch) {
X if (0 == strncmp(acBuf, sizeof(acSub)-1 + *ppch, strlen(acBuf))) {
X return sizeof(acSub)-1 + *ppch;
X }
X }
X return acBuf;
}
X
/*
X * read the given project list file and store in apcProjects (aho)
X */
ReadProjects(pcFile)
char *pcFile;
{
X register FILE *fp;
X register char *pc;
X register int iProject;
X auto char acLine[MAXCHARS];
X
X iProject = 0;
X if ((FILE *)0 == (fp = fopen(pcFile, "r"))) {
X printf("%s: can\'t find project list file in %s\n", progname, pcFile);
X exit(9);
X }
X while ((char *)0 != fgets(acLine, MAXCHARS, fp)) {
X if ('\n' == acLine[0] || '#' == acLine[0])
X continue;
X if (iProject >= MAXPROJECTS) {
X /*ZZZ bogus */
X fprintf(stderr, "%s: too many projects in project file\n", progname);
X exit(10);
X }
X pc = acLine + strlen(acLine) - 1;
X while (isspace(*pc)) {
X *pc-- = '\000';
X }
X apcProjects[iProject++] = strsave(acLine);
X }
X apcProjects[iProject] = (char *)0;
X (void)fclose(fp);
}
X
/*
X * Determine the project name for this submission. If we can't figure it out,
X * we print errors and exit.
X */
static char *
ProjName(pcGuess, pcClass)
X char *pcGuess, *pcClass;
{
X register char **ppch;
X
X for (ppch = apcProjects; (char *)0 != *ppch; ++ppch) {
X switch (**ppch) {
X case '=':
X if ((char *)0 == pcGuess) {
X return 1 + *ppch;
X }
X /*FALLTHROUGH*/
X case '+':
X if ((char *)0 == pcGuess) {
X continue;
X }
X if (0 == strcasecmp(1+*ppch, pcGuess)) {
X return 1 + *ppch;
X }
X break;
X default:
X if ((char *)0 == pcGuess) {
X continue;
X }
X if (0 == strcasecmp(1+*ppch, pcGuess)) {
X fprintf(stderr, "%s: submissions for ", progname);
X if (isdigit(**ppch)) {
X fprintf(stderr, "project ");
X }
X fprintf(stderr, "%s have been turned off.\n", *ppch);
X exit(11);
X }
X }
X }
X if ((char *)0 == pcGuess) {
X fprintf(stderr, "%s: no current project for %s\n", progname, pcClass);
X fprintf(stderr, "Use \"%s -l\" for a list of projects in a course.\n", progname);
X exit(12);
X }
X fprintf(stderr, "%s: ", progname);
X if (isdigit(**ppch)) {
X fprintf(stderr, "Project ");
X }
X fprintf(stderr, "\"%s\" is not a current project for submission in %s. Use\n\"project -l\" for a list of projects in this course.\n", pcGuess, pcClass);
X exit(13);
X /*NOTREACHED*/
}
X
X
/*
X * list the valid projects to stdout; the argument pcClass is for
X * printing headers/error messages
X *
X * (assume that ReadProjects has been called)
X */
static void
ListProjects(pcCourse)
char *pcCourse;
{
X register char **ppch;
X
X if ((char *)0 == apcProjects[0]) {
X printf("There are no current projects for %s\n", pcCourse);
X return;
X }
X printf("Current projects for %s:\n", pcCourse);
X for (ppch = apcProjects; (char *)0 != *ppch; ++ppch) {
X printf("%-16s", 1+*ppch);
X switch (**ppch) {
X case '=':
X printf(" on (current)\n");
X break;
X case '+':
X printf(" on (alternate)\n");
X break;
X default:
X printf(" off\n");
X break;
X }
X }
}
X
X
/*
X * To prevent people from making clever paths to the turnin dirctory
X * with empty components, dots, and slashes, call this routine
X */
static void
GoodFile(pcName, pcWhat)
char *pcName, *pcWhat;
{
X if ((char *)0 == pcName || '\000' == pcName[0]) {
X fprintf(stderr, "%s: no %s specified\n", progname, pcWhat);
X exit(13);
X }
X if ((char *)0 != strchr(pcName, '.')) {
X fprintf(stderr, "%s: will not allow %ss with \'.\' in them\n", progname, pcWhat);
X exit(14);
X }
X if ((char *)0 != strchr(pcName, '/')) {
X fprintf(stderr, "%s: will not allow %ss with \'/\' in them\n", progname, pcWhat);
X exit(15);
X }
}
X
/*
X * show an index of the submitted files (ksb)
X * prefer the uncompressed file
X * tar tvf - <file
X *
X * but show compressed if no other choice
X * compress -d <file | tar tvf -
X */
void
ShowTar(pcFile)
char *pcFile;
{
X auto char *nargv[4];
X auto int pid, n;
X auto int fds[2];
X
X fflush(stdout);
X fflush(stderr);
X switch (pid = fork()) {
X case 0:
X close(0);
X if (0 != open(pcFile, O_RDONLY, 0600)) {
X strcat(pcFile, acDotZ);
X if (0 != open(pcFile, O_RDONLY, 0600)) {
X fprintf(stderr, "%s: open: %s: %s\n", progname, pcFile, strerror(errno));
X exit(1);
X }
X if (0 != pipe(fds)) {
X fprintf(stderr, "%s: pipe: %s\n", progname, strerror(errno));
X exit(1);
X }
X switch (fork()) {
X case -1:
X fprintf(stderr, "%s: fork: %s\n", progname, strerror(errno));
X exit(1);
X case 0: /* zcat of tar file.Z */
X close(1);
X dup(fds[1]);
X close(fds[1]);
X close(fds[0]);
X nargv[0] = "compress";
X nargv[1] = "-d";
X nargv[2] = (char *)0;
X execve(acCompress, nargv, environ);
X /* exec zcat */
X exit(1);
X default: /* |tar fvf - */
X close(0);
X dup(fds[0]);
X close(fds[0]);
X close(fds[1]);
X break;
X }
X }
X nargv[0] = "tar";
X nargv[1] = "-tvf";
X nargv[2] = "-";
X nargv[3] = (char *)0;
X execve(acTar, nargv, environ);
X fprintf(stderr, "%s: execve: %s: %s\n", progname, acTar, strerror(errno));
X exit(21);
X break;
X case -1:
X fprintf(stderr, "%s: fork: %s\n", progname, strerror(errno));
X return;
X default:
X break;
X }
X while (-1 != (n = wait((union wait *)0)) && pid != n)
X ;
}
X
static char acHelp[] =
X "%s: usage [-hlsvV] [-c course[=section]] [-p project] [files]\n";
static char *apcHelp[] = {
X "c course specify the course to use",
X "h print this help message",
X "i output shell commands to set user\'s environment",
X "l list projects active for the selected course",
X "p project specify the project to submit to",
X "s list courses the envoker is enrolled in",
X "v be verbose (also passed to tar)",
X "V show version information",
X "files list of files to submit",
X (char *)0
};
X
/*
X * output a long usage message (ksb)
X */
void
usage(fp)
FILE *fp;
{
X register char **ppc;
X
X fprintf(fp, acHelp, progname);
X for (ppc = apcHelp; (char *)0 != *ppc; ++ppc)
X fprintf(fp, "%s\n", *ppc);
}
X
/*
X * make an archive and transfer to instructors account (ksb)
X */
int
main(argc, argv)
int argc;
char **argv;
{
X register int i, n, pid;
X register char *pcCourse;
X register char **nargv;
X register char *pcProj;
X register char *pcDiv;
X auto char *pcUser;
X auto struct passwd *ppw;
X auto struct group *pgr;
X static char acPath[MAXPATHLEN+1];
X static char acYes[MAXCHARS];
X static int iWho;
X static struct stat stat_buf;
X static union wait wait_buf;
X static char acOnly[] = "%s: only one of -i, -l,or -s may be given\n";
X
X /* RUNS SET UID ROOT */
X
X if ((char *)0 == (progname = strrchr(argv[0], '/')))
X progname = argv[0];
X else
X ++progname;
X
X /*
X * command line parser
X */
X pcCourse = (char *)0;
X pcProj = (char *)0;
X eWhat = UNKNOWN;
X while (EOF != (i = getopt(argc, argv, "hilsp:c:vV"))) {
X switch(i) {
X case 'h':
X usage(stdout);
X exit(0);
X case 'i':
X if (UNKNOWN != eWhat) {
X fprintf(stderr, acOnly, progname);
X exit(1);
X }
X eWhat = INITUSER;
X break;
X case 'l':
X if (UNKNOWN != eWhat) {
X fprintf(stderr, acOnly, progname);
X exit(1);
X }
X eWhat = LISTPROJ;
X break;
X case 's':
X if (UNKNOWN != eWhat) {
X fprintf(stderr, acOnly, progname);
X exit(1);
X }
X eWhat = LISTSUB;
X break;
X case 'V':
X if (UNKNOWN != eWhat) {
X fprintf(stderr, acOnly, progname);
X exit(1);
X }
X eWhat = VERSION;
X break;
X case 'v':
X fVerbose = 1;
X break;
X case 'p':
X pcProj = optarg;
X break;
X case 'c':
X pcCourse = optarg;
X break;
X default:
X fprintf(stderr, acHelp, progname);
X exit(1);
X break;
X }
X }
X if (optind == argc && UNKNOWN == eWhat && 0 == fVerbose) {
X fprintf(stderr, acHelp, progname);
X exit(1);
X }
X
X /*
X * Read submission information from the user's environment, from
X * the instructors project list file, and from our data base, and
X * check it all for consistency.
X */
X ReadDB();
X if (INITUSER == eWhat) {
#ifdef HP_UX
X if (-1 == setresuid(-1, getuid(), -1)) {
X fprintf(stderr, "%s: setresuid: %s\n", progname, strerror(errno));
#else
X if (-1 == seteuid(getuid())) {
X fprintf(stderr, "%s: seteuid: %s\n", progname, strerror(errno));
#endif
X exit(20);
X }
X DoInit(argc-optind, argv+optind, pcCourse);
X exit(0);
X }
X if (VERSION == eWhat) {
X printf("%s: %s\n", progname, RCSId);
X exit(0);
X }
X
X FixEnvironment();
X if (LISTSUB == eWhat) {
X if (0 == iCourses) {
X printf("You are not subscribed to any courses.\n");
X exit(1);
X }
X ListSubscribed(stdout);
X exit(0);
X }
X
X if ((char *)0 == pcCourse && iCourses > 0) {
X pcCourse = Which(pcCourse);
X }
X if ((char *)0 == pcCourse) {
X printf("\n\
For this %s, you may enter the course information interactively.\n", LISTPROJ == eWhat ? "listing" : "submission");
X pcCourse = AskCourse();
X }
X if ((char *)0 != (pcDiv = strchr(pcCourse, '='))) {
X *pcDiv++ = '\000';
X }
X
X if (-1 == (iWho = VerifyCourse(pcCourse))) {
X fprintf(stderr, "%s: cannot find your course (%s) in course list\n", progname, pcCourse);
X exit(7);
X }
X
X (void) setpwent();
X if ((struct passwd *)0 == (ppw = getpwnam(apcUid[iWho]))) {
X printf("%s: owner \"%s\" doesn\'t exist on this machine\n", progname, apcUid[iWho]);
X exit(17);
X }
X (void) setgrent();
X if ((struct group *)0 == (pgr = getgrnam(apcGroup[iWho]))) {
X printf("%s: group \"%s\" doesn\'t exist on this machine\n", progname, apcGroup[iWho]);
X exit(17);
X }
X
X (void)sprintf(acPath, "%s/%s/%s", ppw->pw_dir, apcDir[iWho], PROJLIST);
X ReadProjects(acPath);
X if (LISTPROJ == eWhat) {
X ListProjects(pcCourse);
X exit(0);
X }
X
X pcProj = ProjName(pcProj, pcCourse);
X GoodFile(pcProj, "project");
X
X if ((char *)0 == pcDiv || '\000' == pcDiv[0]) {
X static char acDiv[MAXDIVSEC+1];
X pcDiv = acDiv;
X *pcDiv = '\000';
X FindSection(iWho, stdout, pcDiv);
X }
X GoodFile(pcDiv, "division/section");
X
X (void)sprintf(acPath, "%s/%s/%s", ppw->pw_dir, apcDir[iWho], pcProj);
X if (0 != strcmp(acSectIgnore, pcDiv) || 0 != strcmp(acSectIgnore, apcSections[iWho])) {
X (void)strcat(acPath, "/");
X (void)strcat(acPath, pcDiv);
X }
X /* become the instructor
X */
#ifdef HP_UX
X if (-1 == setresgid(-1, pgr->gr_gid, -1) || -1 == setresuid(-1, ppw->pw_uid, -1)) {
X fprintf(stderr, "%s: setres{u,g}id: %s\n", progname, strerror(errno));
#else
X if (-1 == setegid(pgr->gr_gid) || -1 == seteuid(ppw->pw_uid)) {
X fprintf(stderr, "%s: sete{u,g}id: %s\n", progname, strerror(errno));
#endif
X exit(20);
X }
X
X if (0 != stat(acPath, & stat_buf)) {
X fprintf(stderr, "%s: stat: %s: %s\n", progname, acPath, strerror(errno));
X exit(18);
X }
X strcat(acPath, "/");
X
X /* preserve $USER or $LOGNAME if uid of that name matches our uid
X * this is a gratuitous feature no one will ever use... (ksb)
X */
X if ((char *)0 == (pcUser = getenv("USER"))) {
X pcUser = getenv("LOGNAME");
X }
X if ((char *)0 != pcUser && (struct passwd *)0 != (ppw = getpwnam(pcUser)) && getuid() == ppw->pw_uid) {
X strcat(acPath, pcUser);
X } else if ((struct passwd *)0 != (ppw = getpwuid(getuid()))) {
X strcat(acPath, ppw->pw_name);
X } else {
X fprintf(stderr, "%s: getpwuid(%d): %s\n", progname, getuid(), strerror(errno));
X exit(1);
X }
X
X if (0 != fVerbose && optind == argc) {
X ShowTar(acPath);
X exit(0);
X }
#if CONFIRM
X if (!isatty(fileno(stdin)) || !isatty(fileno(stdout))) {
X /* do not check, we are not interactive */;
X } else if (0 == stat(acPath, & stat_buf)) {
X printf("%s: overwrite previously submitted project? [yn] ", progname);
X if ((char *)0 != GetWord(acYes, MAXCHARS, "yes") && ! ('y' == acYes[0] || 'Y' == acYes[0]))
X exit(0);
X } else {
X strcat(acPath, acDotZ);
X if (0 == stat(acPath, & stat_buf)) {
X printf("%s: overwrite previously submitted project? [yn] ", progname);
X if ((char *)0 != GetWord(acYes, MAXCHARS, "yes") && ! ('y' == acYes[0] || 'Y' == acYes[0]))
X exit(0);
X }
X acPath[strlen(acPath)-sizeof(acDotZ)+1] = '\000';
X }
#endif
X (void)unlink(acPath); /* no symlink to another file */
X
X /*
X ** trash any former compressed files
X */
X strcat(acPath, ".Z");
X (void)unlink(acPath);
X acPath[strlen(acPath)-2] = '\000';
X
X if ((char **)0 == (nargv = (char **)calloc(argc+6, sizeof(char *)))) {
X fprintf(stderr, "%s: out of memory\n", progname);
X exit(18);
X }
X nargv[0] = "tar";
X nargv[1] = "chbf";
X nargv[2] = "1";
X nargv[3] = "-";
X for (i = optind; i < argc; ++i) { /* copy args for tar */
X if ('/' == *argv[i]) {
X fprintf(stderr, "%s: full pathnames not allowed on submitted files\n", progname);
X exit(19);
X }
X nargv[i+4-optind] = argv[i];
X }
X
X fflush(stdout);
X fflush(stderr);
X switch (pid = fork()) { /* child is tar */
X case -1:
X fprintf(stderr, "%s: fork: %s\n", progname, strerror(errno));
X exit(21);
X case 0:
X (void)umask(0077);
X close(1);
X if (1 != open(acPath, O_CREAT|O_TRUNC|O_WRONLY, 0600)) {
X fprintf(stderr, "%s: open: %s: %s\n", progname, acPath, strerror(errno));
X exit(22);
X }
X if (-1 == setuid(getuid()) || -1 == setgid(getgid())) {
X fprintf(stderr, "%s: set{g,u}id: %s\n", progname, strerror(errno));
X exit(1);
X }
X execve(acTar, nargv, environ);
X fprintf(stderr, "%s: exec: %s: %s\n", progname, acTar, strerror(errno));
X exit(21);
X default:
X while (-1 != (n = wait(& wait_buf)) && pid != n)
X ;
X if (-1 == n) {
X fprintf(stderr, "%s: wait: %s\n", progname, strerror(errno));
X exit(22);
X }
X if (0 != wait_buf.w_retcode) {
X fprintf(stderr, "%s: tar failed (%d)\n", progname, wait_buf.w_retcode);
X exit((int)wait_buf.w_retcode);
X }
X break;
X }
X
X /*still instructor here*/
X if (0 != stat(acPath, & stat_buf)) {
X fprintf(stderr, "%s: stat: %s: %s\n", progname, acPath, strerror(errno));
X exit(18);
X }
X if (0 != fVerbose) {
X ShowTar(acPath);
X }
X if (stat_buf.st_size > (off_t) BIGTAR) {
X printf("Compressing submitted files... please wait\n");
X fflush(stdout);
X nargv[0] = "compress";
X nargv[1] = "-f";
X nargv[2] = acPath;
X nargv[3] = (char *)0;
X switch (pid = fork()) { /* child is compress */
X case -1:
X fprintf(stderr, "%s: fork: %s\n", progname, strerror(errno));
X exit(21);
X case 0:
X (void)umask(0077);
X execve(acCompress, nargv, environ);
X fprintf(stderr, "%s: execve: %s: %s\n", progname, acCompress, strerror(errno));
X exit(21);
X default:
X while (-1 != (n = wait(& wait_buf)) && pid != n)
X ;
X if (-1 == n) {
X fprintf(stderr, "%s: wait: %s\n", progname, strerror(errno));
X exit(22);
X }
X if (0 != wait_buf.w_retcode) {
X fprintf(stderr, "%s: compress failed (%d)\n", progname, wait_buf.w_retcode);
X exit((int)wait_buf.w_retcode);
X }
X break;
X }
X } else {
X /* remove any old, larger file */
X (void) strcat(acPath, acDotZ);
X (void) unlink(acPath);
X }
X
X printf("Your files have been submitted to %s, ", pcCourse);
X if (isdigit(*pcProj)) {
X printf("project ");
X }
X printf("%s for grading.\n", pcProj);
X
X (void) endpwent();
X (void) endgrent();
X exit(0);
}
Purdue
chmod 0444 turnin/turnin.c ||
echo 'restore of turnin/turnin.c failed'
Wc_c="`wc -c < 'turnin/turnin.c'`"
test 30395 -eq "$Wc_c" ||
echo 'turnin/turnin.c: original size 30395, current size' "$Wc_c"
fi
# ============= project/project.1l ==============
if test ! -d 'project'; then
echo 'x - creating directory project'
mkdir 'project'
fi
if test -f 'project/project.1l' -a X"$1" != X"-c"; then